﻿using xlstool;

namespace ConsoleApp1
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello, World!");
            var xls = new Excel2003File();
            var sheet = xls.ToSheet("TEST");
            Console.WriteLine(sheet.Name);
            foreach (var row in sheet.LoopRow())
            {
                var cell = row.ToCell("CM");
                Console.WriteLine($"{cell.CellName}{row.RowNo}: {cell.Text}");
            }
            var a = sheet.ToRow(1);
            a.ToCell("A").SetValue("AS");
            var x = a.Hidden;
            var b = sheet.ToRow(2);
            a.CopyTo(b);
            b.Next();
            b.ToCell("A").SetValue("test");
            sheet.SetColumnHidden("A",false);
            a.Height = 32;
            var style = a.ToCell("A").NewStyle();
            style.SetBold();
            style.Font.FontName = "黑体";
            style.Font.FontHeightInPoints = 32;
            style.Style.WrapText = true;
            if (sheet.SheetNo == 0)
            {
                sheet.ChangeSheetName("测试");
                sheet.Active();
            }

            using (var f2 = File.Create("a.xls"))
                xls.ToStream(f2);

        }
    }
}
